package com.dhcc.bpm.modules.safe.mapper;

import com.dhcc.bpm.modules.safe.entity.Flow;
import com.dhcc.bpm.modules.safe.vo.FlowVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName FlowMapper
 * @Description 流量管理表 Mapper 接口
 * @Author daina
 * @Date 2020/2/21 14:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
public interface FlowMapper extends BaseMapper<Flow> {

    /**
     * 自定义分页
     *
     * @param page
     * @param flow
     * @return
     */
    List<FlowVO> selectFlowPage(IPage page, FlowVO flow);
    /**
     * 自定义分页
     *
     * @param page
     * @param flow
     * @return
     */
    List<FlowVO> pageBybasePrdt(IPage page, FlowVO flow);

    /**
     * 查询应用流量详情
     *
     * @param flowVo
     * @return
     */
    FlowVO selectFlowDetail(FlowVO flowVo);

    /**
     * 查询接口流量详情
     *
     * @param flowVo
     * @return
     */
    FlowVO selectApiFlowDetail(FlowVO flowVo);

    /**
     * 查询接口流量详情
     *
     * @param flow
     * @return
     */
    FlowVO selectApiFlowByApiId(FlowVO flow);

    /**
     * 查询应用流量详情
     *
     * @param appId 应用ID
     * @param env   环境
     * @return
     */
    FlowVO selectAppFlowByAppId(String appId, String env);

    /**
     * 查询应用接口流量详情
     *
     * @param flowVo
     * @return
     */
    FlowVO selectAppFlowByAppApi(FlowVO flowVo);

    /**
     * 刷新限流
     *
     * @param flow
     * @return
     */
    int updateRefreshStatus(FlowVO flow);

    /**
     * 刷新限流
     *
     * @param flow
     * @return
     */
    int refreshStatus(FlowVO flow);
    /**
     * 自定义分页
     *
     * @param page
     * @param flow
     * @return
     */
    List<FlowVO> selectFlowPageByApp(IPage page, @Param("flow") FlowVO flow);
}
